package cn.south.campus.business.controller;

import cn.south.campus.business.model.vo.AdVo;
import cn.south.campus.business.service.AdService;
import cn.south.campus.common.model.bo.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author chow
 * @since 2024/12/27 11:23
 */
@RestController
@RequestMapping("/campus/ad")
public class AdController {

    @Resource
    private AdService adService;

    @GetMapping("/list")
    public Result<List<AdVo>> list(@RequestParam String posNo) {
        List<String> posNoList = Arrays.asList(posNo.split(","));
        List<AdVo> list = adService.getByPos(posNoList);
        return Result.success(list);
    }

}
